<!--
 * @description  : 单据管理列表详情
 * @descriptionDetail: 单据管理列表详情
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-12-19 15:33:30
-->
<template>
  <view class="page" style="padding-bottom:0" @tap="itemClick">
    <view class="invent-content">
      <view class="invent-right">
        <view class="r-content">
          <text class="lt-right-title-label">
            {{ itemInfo.docName }}
          </text>
        </view>
        <view class="peo-sty title-sty" style="align-items: center;padding-top: 10rpx;">
          <view>
            <text>
              单据编号：
            </text>
            <text>
              {{ itemInfo.billCode }}
            </text>
          </view>
          <u-tag style="flex-shrink: 0;" :spStyle="getSpStyle(itemInfo)" mode="dark" shape="circle" :text="itemInfo.statusName"></u-tag>
        </view>
        <view class="peo-sty">
          <view>
            <span>{{ itemInfo.billTypeName || '/' }}</span> - <span>{{ itemInfo.storeName || '/' }}</span> - <span>数量：</span><span>{{ itemInfo.qty || 0 }}</span>
          </view>
        </view>
        <view class="peo-sty">
          <view>
            <span>申请人：</span>
            <span>{{ itemInfo.creator }}</span>
            <span style="padding-left: 32rpx;">{{ itemInfo.createTime }}</span>
          </view>
        </view>
        <view class="content-sty">
          <view>
            <text>案件编号：</text>
            <text>{{ itemInfo.caseCode || '/' }}</text>
          </view>
          <view>
            <text>当事人：</text>
            <text>
              {{ itemInfo.party || '/' }}
            </text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { C_STORE_BILL_STATUS, } from "@/service/store/mapping/enum.js"
const sysCodeColors = {
  "02": {
    color: "#01A79A",
    borderColor: "#01A79A",
    backgroundColor: "#C0ECE2",
  },
  "01": {
    color: "#AC0000",
    borderColor: "#AC0000",
    backgroundColor: "#F2CCCC",
  },
  "03": {
    color: "#717579",
    borderColor: "#717579",
    backgroundColor: "#EDEEEF",
  },
};
export default {
  props: {
    itemInfo: {
      type: Object,
      default: () => {
        return {}
      },
    },
  },
  data() {
    return {
    };
  },
  onLoad() {
    this.preParams = this.getRouteParam();
  },
  methods: {
    getSpStyle(it){
      if(it.status == C_STORE_BILL_STATUS.WAIT_CONFIRM){
        return sysCodeColors[it.status] || {};
      }else if(it.status == C_STORE_BILL_STATUS.COMPLETE){
        return sysCodeColors[it.status] || {};
      }else if(it.status == C_STORE_BILL_STATUS.TO_VOLID){
        return sysCodeColors[it.status] || {};
      }
    },
    itemClick(){
      this.setRouteParam(this.itemInfo);
      // 跳转到 出入库单的详情页面
      this.$u.route("pages/store/billManage/detailListItem");
    },
  },
};
</script>

<style lang="scss" scoped>
	@import "../inventoryManage/inven_common.scss";
  .page{
    padding: 0;
  }
  .content {
		background-color: #F3F4F5 ;
    min-height: 100%;
	}
  .list-item-root {
  margin: 10px;
  border-radius: 15px;
  overflow: hidden;
}
.invent-content{
  padding: 24rpx;
}
.lt-right-title-value{
	// margin-left: 16rpx;
	font-size: 30rpx;
	font-weight: 400;
	color: $u-type-warning-dark;
}
.lt-right-title-label{
	font-size: 30rpx;
	font-weight: 600;
	color: $u-main-color;
}

	.key-search-lay {
		background-color: #fff;
		position: fixed;
		/* #ifdef H5-DINGDING  */
		top: 0px;
		/* #endif */
		/* #ifndef H5-DINGDING  */
		top: 44px;
		/* #endif */
		z-index: 999;
		width: 100%;

		.key-search {
			padding: 0 10px;
		}
	}

	.nav-right-icon {
		margin-right: 30rpx;
		font-size: .8rem;
		color: $u-type-primary;
	}
  .title-sty{
    padding-bottom: 22rpx;
    border-bottom: 1px solid #ebebec
  }
  .peo-sty{
    display: flex;
    justify-content: space-between;
    padding-top: 24rpx;
    font-size: 26rpx;
  }
  .label-sty{
    color: #82848a;
    padding-right: 20rpx;
  }
  .value-sty{
    color: #ee8c4f;
  }
  .content-sty{
    color: #82848a;
    background-color: #fafafa;
    padding: 20rpx 10rpx;
    margin-top: 24rpx;
    font-size: 24rpx;
    display: flex;
    justify-content: space-between;
  }
  .pad-top{
    padding-top: 14rpx;
  }
</style>
